package com.jfcloud.common.utils;

import java.util.ArrayList;
import java.util.List;

import com.jfcloud.common.exception.BussinessException;

public class StringUtil {

	
	public static boolean isEmpty(Object s) {
		return s==null || "".equals(s) ;
	}
	
	public static boolean isNotEmpty(Object s) {
		return !isEmpty(s);
	}
	
	/**
	 * 多值分割串 转 数值列表
	 * @param s
	 * @param splitStr
	 * @return
	 */
	public static List<Long> fromSplitStr(String s,String splitStr){
		if(isEmpty(s)) throw new BussinessException("字符串为空");
		
		String[] idArr = s.split(splitStr);
		List<Long> skuIds = new ArrayList<Long>();
		for(String i:idArr) {
			skuIds.add(Long.valueOf(i));
		}
		return skuIds;
	}
}
